<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>demo-idatable</title>
<link href="../jsease.css" rel="stylesheet" type="text/css" />
<style type="text/css">

/*
 * idatable style
 * -----------
 */
.idatable
    {
    width:100%;
    border:1px solid #bbb;
    }
    .idatable .capt
        {
        line-height:23px;
        }
    .idatable .dthead .dhead,
    .idatable .dtfoot .dfoot,
    .idatable .dtbody .ditem
        {
        line-height:23px;
        border:1px solid #bbb;
        background:#f0f3ff;
        cursor:default;
        }
    .idatable .dthead .dhead
        {
        background:#cdf;
        }
.idatable .dtfoot .dfoot{background:#8aefe0;}
    .idatable .dthead .dfilter
        {
        height:24px;
        line-height:24px;
        border:1px solid #bbb;
        }
    .idatable .dtbody .odd
        {
        background:#f2f8ee;
        }
    .idatable .dtbody .hover
        {
        background:#ffc;
        }
    .idatable .dtbody .checked
        {
        background:#ff9;
        }
        .idatable .dthead .dhead .col0,
        .idatable .dthead .dfilter .col0,
        .idatable .dtfoot .dfoot .col0,
        .idatable .dtbody .ditem .col0
            {
            width:23px;
            border:1px solid #bbb;
            text-align:center;
            }
        .idatable .dthead .dhead .col,
        .idatable .dtfoot .dfoot .col,
        .idatable .dtbody .ditem .col
            {
            border:1px solid #bbb;
            }
        .idatable .dthead .dfilter .col{border:1px solid #bbb;overflow:hidden;}
        .idatable .dthead .dfilter .col input{padding:3px 0;height:17px;border:0;text-align:center;background:#fec;}

        .idatable .dthead .dhead .colnone,
        .idatable .dtfoot .dfoot .colnone,
        .idatable .dtbody .ditem .colnone
            {
            width:auto;
            text-align:center;
            }
        .idatable .dtbody .ditem .colnone
            {
            padding:9px 0;
            }
</style>
<script type="text/javascript" src="../core.js"></script>
<script type="text/javascript" src="../idatable.js"></script>
</head>

<body>
<script type="text/javascript">
//<![CDATA[
var cstore={ 'agZvYWxhYnNyDAsSBmNzdG9yZRhkDA':{'guid':'agZvYWxhYnNyDAsSBmNzdG9yZRhkDA', 'atype':'ca', 'regref':'', 'acode':'CN000000', 'aname':'天狮集团总部', 'owner':'', 'addr':'天津市新技术产业园区武清开发区源泉路六号', 'postcode':'301700', 'phone':'022-82124400', 'mobile':'', 'refpo':''},'agZvYWxhYnNyDAsSBmNzdG9yZRhlDA':{'guid':'agZvYWxhYnNyDAsSBmNzdG9yZRhlDA', 'atype':'cb', 'regref':'agZvYWxhYnNyDAsSBmNzdG9yZRhkDA', 'acode':'CN003000', 'aname':'天狮广州分公司', 'owner':'', 'addr':'广东省广州市越秀区永福路2-4号', 'postcode':'510070', 'phone':'020-87685607', 'mobile':'', 'refpo':'agZvYWxhYnNyDAsSBmNzdG9yZRhkDA'} };
function getopts(data, value, text, title){
    var opts=[];
    for ( var k in data){
        if (title){
            opts.push({'value':data[k][value], 'text':{'title':data[k][title], 'text':data[k][text]}});
        } else {
            opts.push({'value':data[k][value], 'text':data[k][text]});
        }
    }
return opts;
}
def( 'demodata', 'idatable', { id:'myidata', tool:0, filter: {col:{'acode':'', 'atype':{type:'select', value:'all', text:'所有类别',opts:function(){return getopts(cstore,'guid','aname');}}},action:'#'}, title:[{cls:'cscode',text:'编码',col:'acode'},{cls:'csname',text:'名称',col:'aname'},{cls:'cstype',text:'类型',col:'atype'},{cls:'cscode',text:'地址',col:'addr'}], data:cstore } );
//]]>
</script>
</body>
</html>